<template>
  <BoUploadExcel
    :uploadApi="upload"
    :submitApi="submit"
    :columns="columns"
  ></BoUploadExcel>
</template>

<script setup lang="tsx">
import { BoUploadExcel } from '@/UploadExcel';
import { ref } from 'vue';

const columns = [
  { title: '序列号', dataIndex: 'deviceCode' },
  { title: '台网代码', dataIndex: 'networkCode' },
  { title: '台站代码', dataIndex: 'stationCode' },
];
const result = ref<any>([]);
const upload = async () => {
  console.log('upload');
  return new Promise((resolve) => {
    result.value = [
      {
        deviceCode: '11111111',
        networkCode: 'BY',
        stationCode: 'TE003',
      },
    ];
    return resolve({
      msg: '操作成功',
      code: 200,
      data: [
        {
          deviceCode: '11111111',
          networkCode: 'BY',
          stationCode: 'TE003',
        },
      ],
    });
  });
};
const submit = () => {
  console.log('submit');
  return {
    msg: '操作成功',
    code: 200,
    data: [],
  };
};
</script>

<style lang="scss" scoped></style>
